package crmdna.inventory;

import com.googlecode.objectify.annotation.Cache;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;

import crmdna.common.UnitUtils.PhysicalQuantity;
import crmdna.common.UnitUtils.ReportingUnit;

@Entity @Cache
public class InventoryItemEntity {
	@Id long inventoryItemId;
	
	@Index long groupId;
	@Index long inventoryItemTypeId;
	
	String displayName;		
	PhysicalQuantity physicalQuantity;
	ReportingUnit reportingUnit;
	
	double quantityInDefaultUnit;
	
	//dependents
	@Index String name;
	@Index String firstChar; //first char of name
			
	public InventoryItemProp toProp() {
		InventoryItemProp prop = new InventoryItemProp();
		
		prop.inventoryItemId = inventoryItemId;
		prop.groupId = groupId;		
		prop.displayName = displayName;		
		prop.quantityInDefaultUnit = quantityInDefaultUnit;
		
		prop.reportingUnit = reportingUnit;
		
		
				
		return prop;		
	}	
}
